﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
using mscook.core.domain;
namespace mscook.mvc.Models
{
    public class CenterInfoModel : CenterBaseModel
    {
        public virtual string Email
        {
            set;
            get;
        }
        public virtual string Address
        {
            set;
            get;
        }

        public virtual string Name
        {
            get;

            set;

        }

        [RegularExpression(@"^http://([\w-]+\.)+[\w-]+(/[\w-./?%&=]*)?$", ErrorMessage = "请填写正确格式的网址")]
        public virtual string SelfPage
        {
            set;
            get;
        }

        [RegularExpression(@"^[0-9]*$", ErrorMessage = "请填写正确格式的电话号码")]
        public virtual string Tel
        {
            get;

            set;

        }

        public void InitLoginUser(LoginUser loginUser)
        {
            this.LoginUser = loginUser;
            Address = loginUser.Address;
            Tel = loginUser.Tel;
            SelfPage = loginUser.SelfPage;
            Name = loginUser.Name;
            Email = loginUser.Email;

        }

    }
}